#T2401020100110 孙奇开
import jieba
import matplotlib.pyplot as plt
from wordcloud import WordCloud
with open(r'某电商平台某款连衣裙的商品评价.txt','r')as file:
    text=file.read()
words=jieba.lcut(text)
words_str=''.join(words)
wordcloud=WordCloud(width=800,height=600,background_color='white',max_words=200,colormap='viridis',
                    font_path='C:\Windows\Fonts\simhei.ttf').generate(words_str)
plt.figure(figsize=(10,6))
plt.title('某电商平台某款连衣裙的商品评价词云图',fontsize=20,pad=20)
plt.imshow(wordcloud)
plt.axis('off')
plt.rcParams['font.sans-serif']='SimHei'
plt.show()